<div class="row align-items-center justify-content-between">
  <div class="col-md-auto col-sm-auto">
    <div class="content-header">
      <h1>
        邮件模板
      </h1>
    </div>
  </div>
  <div class="col-md-auto col-sm-auto">
    <h4 class="widget-title">
      <a class="btn btn-success btn-sm m-right-10" [routerLink]="['/admin/email-template/add']"
        routerLinkActive="router-link-active" routerLinkActive="router-link-active">
        <i class="fas fa-plus"></i>
        添加邮件模板
      </a>
    </h4>
  </div>
</div>
<div class="box box-primary">
  <div class="box-body">
    <div class="table-container">
      <table mat-table [dataSource]="emailTemplates">
        <!-- Action Column -->
        <ng-container matColumnDef="action">
          <th style="width:30%" mat-header-cell *matHeaderCellDef>
            操作
          </th>
          <td style="width:30%" mat-cell *matCellDef="let emailTemplate">
            <a routerLinkActive="router-link-active" [routerLink]="['/admin/email-template', emailTemplate.id]"
              class="btn btn-success btn-sm m-right-10" type="button">
              <i class="fas fa-pen"></i>
              <span class="d-none d-sm-inline"> 编辑</span>
            </a>
            <button class="btn btn-danger btn-sm" (click)="delteEmailTemplate(emailTemplate)">
              <i class="fas fa-trash-alt"></i>
              <span class="d-none d-sm-inline"> 删除</span>
            </button>
          </td>
        </ng-container>
        <!-- Key Column -->
        <ng-container matColumnDef="name">
          <th mat-header-cell *matHeaderCellDef>
           名称
          </th>
          <td mat-cell *matCellDef="let emailTemplate"> {{emailTemplate.name}} </td>
        </ng-container>
        <!-- Value Column -->
        <ng-container matColumnDef="subject">
          <th mat-header-cell *matHeaderCellDef>
            标题
          </th>
          <td mat-cell *matCellDef="let emailTemplate"> {{emailTemplate.subject}} </td>
        </ng-container>

        <tr mat-header-row *matHeaderRowDef="displayedColumns;sticky: true" style="background-color: #eee;"></tr>
        <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
      </table>
    </div>
  </div>
</div>